<?php

    if (!class_exists('ctl_search'))
    {
        require_once(CORE_DIR.'/shop/controller/ctl.search.php');
    }

    class diamond_shop_cct_search extends ctl_search
    {
        function index(){
            $aBrands = array();
            $objBrand = &$this->system->loadModel('goods/brand');
            $this->pagedata['brand'] = $objBrand->getAll();
            $objCat = &$this->system->loadModel('goods/productCat');
            /* alone add start */
            $objDiamondCat = &$this->system->loadModel('plugins/diamond/diamondCat');
            $aDisabledCat = $objDiamondCat->getDisabledCat();
            
            $catList = $objCat->get_cat_list();            
            foreach ($catList as $k=>$v)
            {
                if (in_array($v['cat_id'],$aDisabledCat))
                {
                    unset($catList[$k]);
                }
            }
            $this->pagedata['_MAIN_'] = dirname(__FILE__).'/view/shop/search/index.html';
            /* alone add end */
            $this->pagedata['categorys'] = $catList;
            $this->pagedata['args'] = array($cat_id,$filter,$orderBy,$tab,$page);
            $this->output();
        }
    }

?>
